IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[SrvrInstncGrp]') AND type in (N'U'))
BEGIN
     DROP TABLE [dbo].[SrvrInstncGrp]
END
GO

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

SET ANSI_PADDING ON
GO

CREATE TABLE [dbo].[SrvrInstncGrp](
     [SrvrInstncGrpId]       [int]         NOT NULL,
     [SrvrInstncGrpPriority] [tinyint]     NOT NULL CONSTRAINT [DF_SrvrInstncGrp_SrvrInstncGrpPriority] DEFAULT ((0)),
     [SrvrInstncGrpName]     [varchar](80) NOT NULL,
     [LastModDt]             [datetime]    NOT NULL CONSTRAINT [DF_SrvrInstncGrp_LastModDt] DEFAULT (getdate()),
     CONSTRAINT [PK_SrvrInstncGrp] PRIMARY KEY CLUSTERED ( [SrvrInstncGrpId] ASC )
) ON [PRIMARY]
GO

SET ANSI_PADDING OFF
GO

CREATE UNIQUE NONCLUSTERED INDEX [IX_SrvrInstncGrp_Priority] ON [dbo].[SrvrInstncGrp] 
     ( [SrvrInstncGrpPriority] ASC ) ON [Data_Index]
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Unique Identifier of a particular Server Instance Group.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncGrp', @level2type=N'COLUMN',@level2name=N'SrvrInstncGrpId'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Priority relative to other groups, if more than one group shares the same value there is no way to predict which group will take priority.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncGrp', @level2type=N'COLUMN',@level2name=N'SrvrInstncGrpPriority'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'User-friendly description of the Server Instance Group.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncGrp', @level2type=N'COLUMN',@level2name=N'SrvrInstncGrpName'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'The last date/time the record was changed.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncGrp', @level2type=N'COLUMN',@level2name=N'LastModDt'
GO

EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Server instance groupings.  Contains master list of server groupings, and controls priority of order in execution of servers during audit and collection processes.' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'SrvrInstncGrp'
GO
